package cn.com.surker.material.service;

import cn.com.surker.material.entity.MainMaterialInventoryDetail;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.com.surker.spring.RestResultDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* <p>
    * 材料盘存表 服务类
    * </p>
*
* @author admin
* @since 2024-12-05
*/
public interface MaterialInventoryDetailBaseService extends IService<MainMaterialInventoryDetail> {

    /**
     * 云端分页查询
     * @param orgId
     * @param today
     * @param materialId
     * @param storageId
     * @param storeType
     * @param searchVal
     * @param startTime
     * @param endTime
     * @return
     */
    IPage findCloudPage(Long orgId, String today, Long materialId, Long storageId, Integer storeType, String searchVal,
                        Long lineId, Integer isEnjoy, String startTime, String endTime, Integer offset, Integer limit);

    /**
     * 新增盘存明细
     * @param inventoryDetail
     * @return
     */
    RestResultDto saveDetail(MainMaterialInventoryDetail inventoryDetail);

    /**
     * 更新盘存明细
     * @param inventoryDetail
     * @return
     */
    RestResultDto updateDetail(MainMaterialInventoryDetail inventoryDetail);

    /**
     * 更新明细状态
     * @param id
     * @param status
     * @param creator
     * @return
     */
    RestResultDto updateStatus(Long id, Long orgId, Integer status, String creator);

    /**
     * 补收及任务计算
     * @param orgId
     * @param today
     * @param storageId
     * @param creator
     * @param isCloud
     * @return
     */
    RestResultDto syncDetail(Long orgId, String today, String startTime, String endTime, Long storageId,
                             String creator, Integer isCloud);

    /**
     * 审核盘存明细
     * @param orgId
     * @param today
     * @param creator
     * @param type
     * @return
     */
    RestResultDto examineDetail(Long orgId, String today, String creator, Integer type);

    Integer findCheck(String dbCode, Long orgId, String today);
}
